package com.hyg.lib_music.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;

import com.bumptech.glide.Glide;
import com.hyg.lib_common.Base.BaseActivity;
import com.hyg.lib_music.R;
import com.hyg.lib_music.databinding.ActivityCategoryIntroBinding;
import com.jaeger.library.StatusBarUtil;

public class CategoryIntroActivity extends BaseActivity {
    ActivityCategoryIntroBinding binding;
    String name,content,imageUrl;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding=ActivityCategoryIntroBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        StatusBarUtil.setTransparentForImageViewInFragment(CategoryIntroActivity.this, null);
        init();
    }

    public void init(){
        Intent intent=getIntent();
        name=intent.getStringExtra("name");
        content=intent.getStringExtra("content");
        imageUrl=intent.getStringExtra("image");
        binding.tvContent.setText(content);
        binding.tvTitle.setText(name);

        if(!TextUtils.isEmpty(imageUrl)) {
            Glide.with(this).load(imageUrl).into(binding.ivRoot);
        }
        binding.tvTitle.setTextColor(getResources().getColor(R.color.white));
        binding.back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });





    }


}